import { _decorator, Component, Label, Node } from 'cc';
import { GameManager } from '../GameManager';
const { ccclass, property } = _decorator;

@ccclass('PropertyWindow')
export class PropertyWindow extends Component {
    @property(Label)
    HarmLabel: Label = null;

    @property(Label)
    WeaponHpLabel: Label = null;

    @property(Label)
    HpLabel: Label = null;

    @property(Label)
    FoodSpeedLabel: Label = null;

    @property(Label)
    GoldSpeedLabel: Label = null;

    showAmplification() {
        this.HarmLabel.string = String(GameManager.Instance.userData.propertyAmplification.WEAPON_HARM);
        this.WeaponHpLabel.string = String(GameManager.Instance.userData.propertyAmplification.WEAPON_HP);
        this.HpLabel.string = String(GameManager.Instance.userData.propertyAmplification.ROLE_HP);
        this.FoodSpeedLabel.string = String(GameManager.Instance.userData.propertyAmplification.FOOD);
        this.GoldSpeedLabel.string = String(GameManager.Instance.userData.propertyAmplification.GOLD);
    }

    protected onEnable(): void {
        this.showAmplification();
    }

}


